class Doctor < Location
  
  def process(message)
    case message
    when NewPatient
      deal_with_patient(message)
    when LabResults
      # doctor absorbs results
    when PatientAppointmentComplete
      send_to_clinic(message)
    else
      super
    end
  end  
  
  def deal_with_patient(message)
    @blocked = true
    # needs to take between 1 and 5 minutes to process patient
    future_message(PatientAppointmentComplete.new(message),service_time(5))
  end
  
  def send_to_clinic(message)
    MedSim.send('clinic',DoctorAction.new(message))
  end
  
end